<template>
    <div class="content">
        <side-bar/>
        <div class="main-content bj relative">
            <el-scrollbar style="height: 100%;">
                <div class="bj-data">
                    <div class="bj-list" v-for="(list, index) in lists" :key="index">
                        <h3 class="list-title">{{ list['title'] }}</h3>
                        <div class="item-box" v-for="(item, index) in list['items']" :key="index">
                            <div class="item" v-if="permission.indexOf(item['mid']) != -1" @click="open(item)">
                                <img :src='item["imgSrc"]' alt="">
                                <p class="name">{{item['name']}}</p>
                            </div>
                            <div class="item" v-else>
                                <img :src='item["disabeldImaSrc"]' alt="">
                                <p class="name disabled">{{item['name']}}</p>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- 底部 -->
                <v-footer/>
            </el-scrollbar>
        </div>
    </div>
</template>
<script>
import Footer from '../Footer'
import Header from '../Header'
import SideBar from '@/components/sideBar'
import basicDataMenu from '../../menu/basicDataMenu'
export default {
    components: {
        'v-header': Header,
        'v-footer': Footer,
        'side-bar': SideBar
    },
    data() {
        return {
            permission: this.$store.state.permission,       //用户权限
            lists: basicDataMenu
        }
    },
    methods: {
        open(item) {        //打开弹窗
            if(item['data']) {
                if(this.$util.isMobile()) item['data']['height'] = '600px';
                this.$util.openLayerIframe(item['data']);
            } else {
                this.$alert('模块开发中...', '系统提示', {
                    confirmButtonText: '关闭'
                });
            }
        }
    }
}
</script>
<style scoped>
    .disabled {color: #999;}
</style>